package org.spring.springboot.controller;

import org.spring.springboot.domain.mongoEntity.M_BaoLan;
import org.spring.springboot.service.M_BaoLanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("mg")
public class M_BaoLanController {

  @Autowired private M_BaoLanService M_BaoLanService;

  @RequestMapping(value = "save", method = RequestMethod.POST)
  public ResponseEntity save(M_BaoLan baoLan) {
    M_BaoLan save = M_BaoLanService.save(baoLan);
    return ResponseEntity.ok(save);
  }

  @RequestMapping(value = "findById", method = RequestMethod.POST)
  public ResponseEntity save(Long id) {
    M_BaoLan save = M_BaoLanService.find(id);
    return ResponseEntity.ok(save);
  }
}
